<?php

class Contract extends Mysql {
	public function __construct() {
		parent::__construct();
	}
	/**
	 * 添加一个联系
	 * @param unknown_type $name
	 * @param unknown_type $email
	 * @param unknown_type $content
	 * @param unknown_type $ip
	 */
	public function add($name, $email, $content, $ip) {
		$sql = "insert into contract(name, email, content, time, ip)
			 values
				('$name', '$email', '$content', NOW(), '$ip');";
		return $this->exec_update($sql);
	}
	/**
	 * 删除一个联系
	 * @param unknown_type $id
	 */
	public function delete($id) {
		return $this->exec_update("delete from contract where id= $id;");
	}
 }

?>